package com.pocket.demo.business.service;

import com.pocket.demo.core.security.PocketUser;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.UserDetailsService;

/**
 * @author zhaozhile
 */
public interface PocketUserDetailsService extends UserDetailsService {

    void onLoginSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication);

    void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication);

    PocketUser loadUserBySessionId(String sessionId);

    void saveUserSession(String sessionId, PocketUser user);

}
